package cn.lili.modules.exception;

import cn.lili.common.exception.BaseServiceException;

/**
 * @author:xiangqian
 * @date: 2024/3/8 17:25
 */
public class MyAssert {

    public static void notNull(Object object, String message) {
        if (object == null) {
            throw new BaseServiceException(message);
        }
    }

    public static void isTrue(boolean expression, String message) {
        if (!expression) {
            throw new BaseServiceException(message);
        }
    }

    public static void isNotTrue(boolean expression, String message) {
        if (expression) {
            throw new BaseServiceException(message);
        }
    }
}
